<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
<style type="text/css">
	ss{position: absolute;
	border: 1px solid ghostwhite;}
</style>
	<body>
		<script>
			var str = location.href;
			/*indexOf() 方法可返回某个指定的字符串值在字符串中首次出现的位置*/
			var num = str.indexOf("?");
			/*substr() 方法可在字符串中抽取从 start 下标开始的指定数目的字符。*/
			/*var str="Hello world!"
			 document.write(str.substr(3,7))
//			结果是；loworld */
			str = str.substr(num + 1);
			var arr = str.split("&");
			for(var i = 0; i < arr.length; i++) {
				num = arr[i].indexOf("=");
				if(num > 0) {
					name = arr[i].substring(0, num);
					value = arr[i].substr(num + 1);
					this[name] = value;
				}
			}
		</script>
	</body>

</html>